import crypto from 'crypto'

// 存储token
export const setItem = function(data) {
    let token = ''
    if(typeof data === 'object') {
        token = JSON.stringify(data)
    }
    window.localStorage.setItem('my-token', token)
}

export const getItem = function() {
    let token = window.localStorage.getItem('my-token')
      ? window.localStorage.getItem('my-token')
      : ''
    console.log(token + "++++++++++++++++++++++++++++++++++++++++++++");
    return token ? JSON.parse(token) : ''
}